package com.gy.smartmanagement.process.processdevice.fragment;

import android.os.Bundle;

import com.gy.smartmanagement.R;
import com.gy.smartmanagement.base.fragment.BaseListFragment;
import com.gy.smartmanagement.process.processdevice.adapter.FixAdapter;
import com.gy.smartmanagement.process.processdevice.mvp.FixBean;
import com.gy.smartmanagement.process.processdevice.mvp.NumberBean;

import java.util.ArrayList;
import java.util.List;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import tl.com.easy_recycleview_library.BaseRecyclerViewAdapter;

public class FixFragment extends BaseListFragment<FixBean> {

  @BindView(R.id.fix_rv)
  RecyclerView fix_rv;

  public static final String TAG = "FixFragment";

  public static FixFragment newInstance() {

    Bundle args = new Bundle();

    FixFragment fragment = new FixFragment();
    fragment.setArguments(args);
    return fragment;
  }

  @Override
  public int getLayoutResId() {
    return R.layout.fragment_fix;
  }

  @Override
  public void onUnBind() {

  }

  @Override
  protected void initView() {
    //模拟组装10个数据
    List<FixBean> dataList = new ArrayList<>();
    for (int i = 0; i < 10; i++) {
      FixBean bean = new FixBean();
      bean.setName("data.add " + i);
      bean.setNumber(""+i);
      bean.setPersion("lilei");
      bean.setPosition("三航大厦");
      bean.setTime("2019-11-21");
      dataList.add(bean);
    }

    FixAdapter fixAdapter=new FixAdapter(getContext(),dataList,R.layout.item_fix);
    BaseRecyclerViewAdapter adapter=new BaseRecyclerViewAdapter(fixAdapter);

    recycleView.setLayoutManager(new LinearLayoutManager(getContext()));
    recycleView.setAdapter(adapter);
    canLoadMore(false);
    canPull(false);

    recycleView.setAdapter(adapter);
  }

}
